/*
 * Title:        CloudScheduler Toolkit
 * Description:  a Toolkit for Modeling and Simulation of Job Scheduling and Resource Provisioning in Cloud System
 * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
 * Author:       Fuhui Wu
 *
 * Copyright (c) 2013-2014, The National University of Defense Technology, China
 */

package org.nudt.jCloud.fileSystem;
import java.util.ArrayList;
import java.util.List;

import org.nudt.jCloud.infrastructure.Cluster;

public class FileSystem {
	private List<File> fileList;
	private Cluster cluster;
	private Storer storer;
	private int index = 0;
	
	public FileSystem(Cluster cluster, Storer storer){
		setCluster(cluster);
		setStorer(storer);
		fileList = new ArrayList<File>();
	}

	public void addFile(File file){
		file.setId(index++);
		fileList.add(file);
		storer.store(file, cluster);
	}
	
	public List<File> getFileList() {
		return fileList;
	}

	public void setFileList(List<File> fileList) {
		this.fileList = fileList;
	}
	
	public Cluster getCluster(){
		return cluster;
	}
	
	public void setCluster(Cluster cluster){
		this.cluster = cluster;
	}

	public Storer getStorer() {
		return storer;
	}

	public void setStorer(Storer storer) {
		this.storer = storer;
	}

}
